package cn.wolfcode.qo;

import cn.wolfcode.enums.ConsumptionReportEnums;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Setter
@Getter
public class ConsumptionReportQueryObject extends  QueryObject{
        private  String groupByName= ConsumptionReportEnums.BUSINESS.name();
        private  Long businessId;
        @DateTimeFormat(pattern = "yyyy-MM-dd")
        private Date startDate;
        @DateTimeFormat(pattern = "yyyy-MM-dd")
        private Date endDate;
        private Integer typeId;


        public String getGroupBy(){
                return ConsumptionReportEnums.valueOf(this.groupByName).getSql();
        }
}
